import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/view/Login.vue'
import Navagation from '@/components/Navagation'

import InStorage from '@/components/InStorage'
import OutStorage from '@/components/OutStorage'
import BatchInventory from '@/components/BatchInventory'
import InventoryDetail from '@/view/inventory/index'
import InStorageDetail from '@/components/InStorageDetail'
import OutStorageDetail from '@/components/OutStorageDetail'
import OutStorageMaterialDetail from '@/components/OutStorageMaterialDetail'
import InStorageMaterialDetail from '@/components/InStorageMaterialDetail'
import HasScanedDetail from '@/components/HasScanedDetail'
import Settings from '@/components/Settings'

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/login',
      meta:{keepAlive: false}
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta:{keepAlive: false}
    },
    {//入库页面
      path: "/inStorage",
      component: InStorage,
      name: 'InStorage',
      meta:{keepAlive: false}
    },
    {//出库页面
      path: "/outStorage",
      component: OutStorage,
      name: 'OutStorage',
      meta:{keepAlive: false}
    },
    {//出库详情页面
      path: "/outStorageDetail",
      component: OutStorageDetail,
      name: 'OutStorageDetail',
      meta:{keepAlive: false}
    },
    //出库物料详情页面
    {
      path: "/outStorageMaterialDetail",
      component: OutStorageMaterialDetail,
      name: 'OutStorageMaterialDetail',
      meta:{keepAlive: false}
    }
    ,
    {
      path: "/inStorageDetail",
      component: InStorageDetail,
      name: 'InStorageDetail',
      meta:{keepAlive: false}
    },
    {
      path: '/inventoryDetail',
      name: 'InventoryDetail',
      component: InventoryDetail,
      meta:{keepAlive: false}
    },
    {
      path: '/batchInventory',
      name: 'BatchInventory',
      component: BatchInventory,
      meta:{keepAlive: false}
    },
    {
      path: '/settings',
      name: 'Settings',
      component: Settings,
      meta:{keepAlive: false}
    },
    {
      path: '/inStorageMaterialDetail',
      name: '/InStorageMaterialDetail',
      component: InStorageMaterialDetail,
      meta:{
        keepAlive: false,// 判断该组件是否需要缓存
        isBack: false // 判断是不是返回操作
      }
    },
    {
      path: '/navagation',
      name: '/Navagation',
      component: Navagation,
      meta:{keepAlive: false}
    },
    {
      path: '/hasScanedDetail',
      name: '/HasScanedDetail',
      component: HasScanedDetail,
      meta:{keepAlive: false}
    },
    {
      path: '/OutStorageWuliao',
      name: '/OutStorageWuliao',
      component: () => import('@/components/OutStorageWuliao'),
      meta:{keepAlive: false}
    },
    {
      path: '/OutCodeDetail',
      name: '/OutCodeDetail',
      component: () => import('@/components/OutCodeDetail'),
      meta:{keepAlive: false}
    },
    // 盘库
    {
      path: '/SeeStorageIndex',
      name: '/SeeStorageIndex',
      component: () => import('@/components/SeeStorage/index'),
      meta:{keepAlive: false}
    },
    {
      path: '/MateriaList',
      name: '/MateriaList',
      component: () => import('@/components/SeeStorage/MateriaList'),
      meta:{keepAlive: false}
    },
    // {
    //   path: '/InventoryDiffer',
    //   name: '/InventoryDiffer',
    //   component: () => import('@/components/SeeStorage/InventoryDiffer'),
    //   meta:{keepAlive: false}
    // },
    // {
    //   path: '/InventoryWuLiao',
    //   name: '/InventoryWuLiao',
    //   component: () => import('@/components/SeeStorage/InventoryWuLiao'),
    //   meta:{keepAlive: false}
    // },
    // {
    //   path: '/InventoryCode',
    //   name: '/InventoryCode',
    //   component: () => import('@/components/SeeStorage/InventoryCode'),
    //   meta:{keepAlive: false}
    // },
    {
      path: '/articleList',
      name: '/articleList',
      component: () => import('@/components/SeeStorage/articleList'),
      meta:{keepAlive: false}
    },
    // 移库
    {
      path: '/MoveStore',
      name: '/MoveStore',
      component: () => import('@/components/MoveStore/index'),
      meta:{keepAlive: false}
    },
  ]
})
